<?php
$params = array_merge(
    require(__DIR__ . '/../../common/config/params.php'),
    require(__DIR__ . '/../../common/config/params-local.php'),
    require(__DIR__ . '/params.php'),
    require(__DIR__ . '/params-local.php')
);

return [
    'name' => 'HR管理系统v1.0',
    'id' => 'app-backend',
    'basePath' => dirname(__DIR__),
    'controllerNamespace' => 'backend\controllers',
    'bootstrap' => ['log'],
    'modules' => [
        'admin' => [
            'class' => 'mdm\admin\Module',
            'layout' => 'left-menu',//yii2-admin的导航菜单
        ],
        'kingdee'         => [
            'class' => 'backend\modules\kingdee\KingdeeModule',
        ],
        'qywx'         => [
            'class' => 'backend\modules\qywx\QywxModule',
            // Optional, but if defined, all must be declared
//            'tableMap' => [
//                'user_table'            =>  '{{%user}}',
//                'username_field'        =>  'username',
//                'email_field'           =>  'email',
//                'password_hash_field'   =>  'password_hash',
//                'fullname_field'        =>  'fullname',
//                'avatar_field'          =>  'avatar',
//                'position_field'        =>  'position',
//            ],
        ],
        'mdm'         => [
            'class' => 'backend\modules\mdm\MdmModule',
        ],
        'bi'         => [
            'class' => 'backend\modules\bi\BiModule',
        ],
        'treemanager' =>  [
            'class' => '\kartik\tree\Module',
            // other module settings, refer detailed documentation
        ]
    ],
    'components' => [
        'request' => [
            'csrfParam' => '_csrf-backend',
        ],
        'user' => [
            'identityClass' => 'common\models\User',
            'enableAutoLogin' => true,
            'identityCookie' => ['name' => '_identity-backend', 'httpOnly' => true],
        ],
        'session' => [
            // this is the name of the session cookie used for login on the backend
            'name' => 'advanced-backend',
        ],
        'log' => [
            'traceLevel' => YII_DEBUG ? 3 : 0,
            'targets' => [
                [
                    'class' => 'yii\log\FileTarget',
                    'levels' => ['error', 'warning'],
                ],
            ],
        ],
        'errorHandler' => [
            'errorAction' => 'site/error',
        ],
    ],
    'as access' => [
        'class' => 'mdm\admin\components\AccessControl',
        'allowActions' => [
            'site/*',//允许访问的节点，可自行添加
            'admin/*',//允许所有人访问admin节点及其子节点
            'gii/*',
            'qywx/auth/*',
        ]
    ],
    'params' => $params,
];
